import req from "../../utils/request";
import qs from 'qs'

//查询系统外键下拉
export function get_getSystem(query) {
  return req({
    url: "/api/getSystem",
    method: "get",
    params: query,
  });
}

//获取组件类型
export function get_getPClass(query) {
  return req({
    url: "/api/getPClass",
    method: "get",
    params: query,
  });
}

//据组件id返回函数信息
export function get_getFunctionByPluginsId(query) {
  return req({
    url: "/jna/getFunctionByPluginsId",
    method: "get",
    params: query,
  });
}

//查询组件类型
export function get_getPLibrarySelect(query) {
  return req({
    url: "/api/getPLibrarySelect",
    method: "get",
    params: query,
  });
}

//录入组件信息
export function put_pluginsAdd(query) {
  return req({
    url: "/api/pluginsAdd",
    method: "put",
    data: query,
  });
}

//组件类型新增
export function put_addPLibrary(query) {
  return req({
    url: "/api/addPLibrary",
    method: "put",
    data: qs.stringify(query),
  });
}

//录入运行环境
export function put_PRequireAdd(query) {
  return req({
    url: "/api/pRequireAdd",
    method: "put",
    data: query,
  });
}

//录入组件函数
export function put_funactonAdd(query) {
  return req({
    url: "/api/functonAdd",
    method: "put",
    data: qs.stringify(query),
  });
}

//删除组件函数
export function del_deletePFunction(query) {
  return req({
    url: "/api/deletePFunction",
    method: "delete",
    data: qs.stringify(query),
  });
}

//录入组件函数参数
export function put_paramAdd(query) {
  return req({
    url: "/api/paramAdd",
    method: "put",
    data: query,
    headers: {
      'Content-Type': 'application/json'
    },
  });
}

//删除未关联应用
export function del_deleteAApplication(query) {
  return req({
    url: "/api/deleteAApplication",
    method: "delete",
    data: query,
    headers: {
      'Content-Type': 'application/json'
    },
  });
}

//修改组件信息
export function put_updatePluginsInfo(query) {
  return req({
    url: "/api/updatePluginsInfo",
    method: "put",
    data: query,
    headers: {
      'Content-Type': 'application/json'
    },
  });
}

//组件纳入库
export function put_libraryAdd(query) {
  return req({
    url: "/api/libraryAdd",
    method: "put",
    headers: {
      'Content-Type': 'application/json'
    },
    data: query,
  });
}

//监控新增
export function put_monitorAdd(query) {
  return req({
    url: "/api/monitorAdd",
    method: "put",
    data: qs.stringify(query),
  });
}

//切换新增
export function put_switchAdd(query) {
  return req({
    url: "/api/switchAdd",
    method: "put",
    data: qs.stringify(query),
  });
}

//一键检测
export function post_loadDll(query) {
  return req({
    url: "/jna/pluginsRunTest",
    method: "put",
    data: query,
    headers: {
      'Content-Type': 'application/json'
    },
  });
}

//websockte检测组件的未注册
export function get_getPlagesNoTest(query) {
  return req({
    url: "/api/getPlagesNoTest",
    method: "get",
    params: query,
  });
}

//组件批量检测
export function put_pluginsBacthTest(query) {
  return req({
    url: "/jna/pluginsBacthTest",
    method: "put",
    data: query,
    headers: {
      'Content-Type': 'application/json'
    },
  });
}

//修改组件与函数信息
export function post_updateFunction(query) {
  return req({
    url: "/api/updateFunction",
    method: "put",
    data: qs.stringify(query),
  });
}
